var e = require("../../../common/vendor.js"), r = require("../../../api/ajax.js");

require("../../../api/service.js"), require("../../../utils/luch-request/core/Request.js"), 
require("../../../utils/luch-request/core/dispatchRequest.js"), require("../../../utils/luch-request/adapters/index.js"), 
require("../../../utils/luch-request/helpers/buildURL.js"), require("../../../utils/luch-request/utils.js"), 
require("../../../utils/luch-request/core/buildFullPath.js"), require("../../../utils/luch-request/helpers/isAbsoluteURL.js"), 
require("../../../utils/luch-request/helpers/combineURLs.js"), require("../../../utils/luch-request/core/settle.js"), 
require("../../../utils/luch-request/core/InterceptorManager.js"), require("../../../utils/luch-request/core/mergeConfig.js"), 
require("../../../utils/luch-request/core/defaults.js"), require("../../../utils/luch-request/utils/clone.js"), 
require("../../../uni_modules/u-store/js_sdk/Storage.js"), require("../../../config/config.js");

var o = {
    setup: function() {
        var r = e.useStore();
        return {
            login: function(e) {
                r.commit("userModel/login", e);
            },
            logout: function() {
                r.commit("userModel/logout");
            },
            upInfo: function(e) {
                r.commit("userModel/upInfo", e);
            },
            userModel: r.state.userModel
        };
    },
    data: function() {
        return {
            model1: {
                userInfo: {
                    mobile: "",
                    password: ""
                }
            },
            rules: {
                "userInfo.mobile": {
                    type: "string",
                    required: !0,
                    message: "请填写您的手机号码！",
                    trigger: [ "blur", "change" ]
                },
                "userInfo.password": {
                    type: "string",
                    required: !0,
                    message: "请填写您的密码！",
                    trigger: [ "blur", "change" ]
                }
            }
        };
    },
    methods: {
        submit: function() {
            var o = this;
            this.$refs.form.validate().then(function(u) {
                r.doPostUrl("member.Passport/login", o.model1.userInfo).then(function(r) {
                    var u = r.data;
                    if (u.code) {
                        var t = u.data;
                        console.log("infoData", t), o.login(t), e.index.navigateBack({
                            delta: o.delta
                        });
                    } else e.index.showToast({
                        title: "账号或者密码错误！",
                        icon: "none"
                    });
                });
            }).catch(function(r) {
                e.index.showToast({
                    icon: "error",
                    title: "校验失败"
                });
            });
        },
        reset: function() {
            this.$refs.form.resetFields(), this.$refs.form.clearValidate();
        },
        hideKeyboard: function() {
            e.index.hideKeyboard();
        }
    }
};

Array || (e.resolveComponent("uv-gap") + e.resolveComponent("uv-input") + e.resolveComponent("uv-form-item") + e.resolveComponent("uv-button") + e.resolveComponent("uv-form"))(), 
Math || (function() {
    return "../../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
} + function() {
    return "../../../uni_modules/uv-input/components/uv-input/uv-input.js";
} + function() {
    return "../../../uni_modules/uv-form/components/uv-form-item/uv-form-item.js";
} + function() {
    return "../../../uni_modules/uv-button/components/uv-button/uv-button.js";
} + function() {
    return "../../../uni_modules/uv-form/components/uv-form/uv-form.js";
})();

var u = e._export_sfc(o, [ [ "render", function(r, o, u, t, s, n) {
    return {
        a: e.p({
            height: "10",
            bgColor: "#fff"
        }),
        b: e.p({
            height: "10",
            bgColor: "#fff"
        }),
        c: e.o(function(e) {
            return s.model1.userInfo.mobile = e;
        }),
        d: e.p({
            border: "none",
            modelValue: s.model1.userInfo.mobile
        }),
        e: e.p({
            label: "手机号码:",
            prop: "userInfo.mobile",
            borderBottom: !0
        }),
        f: e.o(function(e) {
            return s.model1.userInfo.password = e;
        }),
        g: e.p({
            border: "none",
            modelValue: s.model1.userInfo.password
        }),
        h: e.p({
            label: "您的密码:",
            prop: "userInfo.password",
            borderBottom: !0
        }),
        i: e.o(n.submit),
        j: e.p({
            type: "primary",
            text: "提交",
            customStyle: "margin-top: 10px"
        }),
        k: e.o(n.reset),
        l: e.p({
            type: "error",
            text: "重置",
            customStyle: "margin-top: 10px"
        }),
        m: e.sr("form", "ee527483-2"),
        n: e.p({
            labelWidth: "80",
            labelPosition: "left",
            model: s.model1,
            rules: s.rules
        })
    };
} ], [ "__scopeId", "data-v-ee527483" ] ]);

wx.createPage(u);